﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Template/ListRight.master" AutoEventWireup="true" CodeFile="MonthlyList2.aspx.cs" Inherits="Page_MonthlyList2" %>

<%@ Register Src="~/Common/PortalPager.ascx" TagName="pager" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../Js/calendar.js"></script>
    <script src="../Js/jquery.js"></script>
   
    <link href="../Style/Css/calendar.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        $(document).ready(function () {
            $("#tblList tbody tr td input").each(function () {

                $(this).click(function () {
                    var count1 = $("#tblList tbody tr td input:checked").length;
                    var count2 = $("#tblList tbody tr td input").length;
                    if (count1 == count2) {
                        $("#cbAll").attr("checked", true);
                    }
                    else
                        $("#cbAll").attr("checked", false);
                });

            });

            $("#cbAll").click(function () {
                $("#tblList tbody tr td input").attr("checked", this.checked);
            });
            $(window).resize(function () {

                PageSize2();
            });
            PageSize2();
        });

        function PageSize2() {
            var height = document.body.clientHeight;

            var trInfo = document.getElementById("trInfo");
            var mainList = document.getElementById("MainContent2");


            if (height > 108 + trInfo.offsetHeight) {
                mainList.style.height = (height - 108 - trInfo.offsetHeight) + "px";
            }
        }
        function confirmDelete() {
            var ids = '';
            $("#tblList tbody tr td input:checked").each(function () {
                ids += this.id.substring(2, 38) + ';';

            });
            if (ids != '') {
                $("#<%=hfIDs.ClientID%>").val(ids);

                return window.confirm('确认删除?');
            }
            else {
                alert('请选择');
                return false;
            }
        }
        function openEdit(id) {
            var width = 840;
            var height =630 ;
            if (id == undefined)
                window.open("EditMonthly.aspx?DeptID=<%=DeptID %>&NoCache=" + Math.random(), "newwindow", 'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=' + (screen.width - width) / 2 + ',top=' + (screen.height - height) / 2);
            else
                window.open("EditMonthly.aspx?ID=" + id + "&NoCache=" + Math.random(), "newwindow", 'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=' + (screen.width - width) / 2 + ',top=' + (screen.height - height) / 2);

        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ListToolBarPlaceHolder" runat="Server">
    <table cellspacing="2" cellpadding="0" border="0" runat="server">
        <tr>
            <td class="ToolMenu" width="60" id="tdEdit" runat="server">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)"
                    onclick="openEdit();">
                    <span>
                        <img src="../Images/Icon/object/Dataset-edit.gif" /></span><span>添加</span>
                </div>
            </td>
            <td class="Fg" id="tdEditFg" runat="server">
                <img src="../Images/FgLine.gif" alt="" />
            </td>
            <td class="ToolMenu" width="60" id="tdDelete" runat="server">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                    <asp:LinkButton runat="server" ID="lbtnDelete" OnClick="lbtnDelete_Click" OnClientClick="return confirmDelete()">
                        <span><img src="../Images/Icon/object/Dataset-delete.gif" /></span><span>删除</span>
                    </asp:LinkButton>
                </div>
            </td>
            <td class="Fg" id="td2" runat="server">
                <img src="../Images/FgLine.gif" alt="" />
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TitleContentPlaceHolder" runat="Server">
    <table cellspacing="4" cellpadding="0" border="0">
        <tr>
            <td style="width: 100px;">&nbsp;发布日期：
            </td>
            <td>
                <asp:TextBox ID="tbDateStart" runat="server" onfocus="calendar();" class="Textbox01"></asp:TextBox>
            </td>
            <td>&nbsp;---&nbsp;
            </td>
            <td>
                <asp:TextBox ID="tbDateEnd" runat="server" onfocus="calendar();" class="Textbox01"></asp:TextBox>
            </td>
        </tr>

        <tr>
            <td>&nbsp;文件名称：
            </td>
            <td>
                <asp:TextBox ID="tbFileName" runat="server" class="Textbox01"></asp:TextBox>
            </td>
            <td colspan="2">
                <asp:Button ID="btnAdvancedSearch" runat="server" CssClass="Button01" Text="开始查询"
                    OnClick="btnAdvancedSearch_Click" />
            </td>
        </tr>
    </table>

</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="InfoContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="TextContentPlaceHolder" runat="Server">
    <div class="ScrollDiv" id="MainContent2">
        <asp:HiddenField runat="Server" ID="hfIDs" />
        <table cellspacing="0" cellpadding="0" border="0" width="100%" class="PageGridHeader">
            <tr>
                <td width="30" align="center">
                    <input id='cbAll' type="checkbox" name="cbAll" /></td>
                <td align="center">文件名称</td>
                <td width="140" align="center">发布时间</td>
            </tr>
        </table>
        <table cellspacing="0" cellpadding="0" id="tblList" border="0" width="100%" class="MainInfolist"> 
            <asp:Repeater ID="rptFiles" runat="server">
                <ItemTemplate>
                    <tr id="TableRow_<%# Container.ItemIndex%>" style="cursor: pointer" class="Normal"
                        onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                        <td width="30">
                            <input id="cb<%#Eval("ID") %>" type="checkbox" name="cb<%#Eval("ID") %>" />

                        </td>

                        <td onclick="openEdit('<%#Eval("ID") %>')">&nbsp;<%# Eval("FileName")%></td>
                        <td width="140" align="center">
                            <a>
                                <%#Eval("PublishTime","{0:yyyy-MM-dd}")%></a>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>

    </div>
    <uc:pager runat="server" ID="pager1" OnPreRender="pager_PreRender"></uc:pager>

</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="TabberContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="Div1ContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="Div2ContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="Div3ContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content10" ContentPlaceHolderID="Div4ContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content11" ContentPlaceHolderID="Div5ContentPlaceHolder" runat="Server">
</asp:Content>

